﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CacheSharp.Core;

namespace CacheSharp.Test
{
    class Program
    {
        static void Main(string[] args)
        {

            var names = CacheFactory.GetCacherNames();
            CacheFactory cache = new CacheFactory(names.First());
            string groupName = Guid.NewGuid().ToString();
            cache.SetValue(groupName, "1", 1);
            cache.SetValue(groupName, "2", 2);
            cache.SetValue(groupName, "3", 3, DateTime.Now + new TimeSpan(0,0,0,2));
            Console.WriteLine(@"Key = '1', Value = " + cache.GetValue(groupName, "1"));
            Console.WriteLine(@"Key = '3', Value = " + cache.GetValue(groupName, "3"));



            System.Threading.Thread.Sleep(3000);
            cache.DelExpire();
            Console.WriteLine(@"Key = '3', Value = " + cache.GetValue(groupName, "3"));


            Console.ReadLine();
        }
    }
}
